# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-validate-pyproject
pkgver=0.22
pkgrel=0
pkgdesc="Validation library for simple check on pyproject.toml"
url="https://validate-pyproject.readthedocs.io"
arch="noarch"
license="MPL-2.0"
depends="
	py3-fastjsonschema
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/abravalheri/validate-pyproject/archive/refs/tags/v$pkgver.tar.gz
	no-useless-check.patch
	"
builddir="$srcdir/validate-pyproject-$pkgver"
options="net" # tests require network

build() {
	gpep517 build-wheel	\
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto -k 'not test_downloaded and not test_private_classifier'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
3104aaf2f9c78e354ba1cf63661e7d3f70d4940b2698755dbf16d790d4d370b734fa0b02355a0293b1183364b5101148b89c8b404d95481cd2ff43dbadf216f2  py3-validate-pyproject-0.22.tar.gz
1c538f93301c30cd5a62011692fb33e6638f4167ab3365f0dbb0f6857f75baf2131b959db2ff55c2ef81d8c1df38566220cd8e029b4fb61441f27005e4cd6798  no-useless-check.patch
"
